Skip to content

Dev/refacto#30

Merged
Jeck0v merged 4 commits intomainfrom
dev/refacto
Feb 11, 2026
Merged

Dev/refacto#30
Jeck0v merged 4 commits intomainfrom
dev/refacto

Conversation

@Jeck0v
Copy link
Copy Markdown
Owner

@Jeck0v Jeck0v commented Feb 11, 2026

Refactoring: clean codebase, improve generation quality, rewrite README

Context

Full audit of the codebase followed by three axes of improvement:
removal of dead code and unused dependencies, application of Rust idioms,
and improvements to the Docker Compose generation output.

The README has been rewritten to reflect the actual state of the project
instead of overpromising on "production-ready" capabilities.

What changed

Dead code elimination

  • Deleted optimized_parser.rs (325 lines, entirely unused)
  • Removed AthenaConfig, legacy structs in compose.rs, TemplateError variant,
    ValidationErrorType enum, NetworkMode enum, PullPolicy enum
  • Removed all dead factory methods and unused fields across the codebase
  • 36 #[allow(dead_code)] reduced to 0

Unused dependencies

  • Removed uuid, anyhow, tempfile from main dependencies (none were imported)
  • Added indexmap for deterministic service ordering

Rust idioms

  • Replaced unwrap() in production code with get_or_insert_with
  • Replaced byte-indexed string slicing with strip_prefix/strip_suffix
  • Replaced format_push_string with write!/writeln!
  • Applied inline format args across the codebase
  • Replaced wildcard imports (use ast::*) with explicit imports
  • Simplified should_be_verbose, execute_info, calculate_similarity,
    validate_build_args_against_dockerfile

Docker Compose generation

  • Removed container_name from output (was blocking docker compose --scale)
  • Removed pull_policy: missing (redundant, Docker's default)
  • deploy.restart_policy is now only emitted when Swarm features are used,
    eliminating the conflict with the top-level restart: field
  • Labels, networks and volumes use BTreeMap for deterministic ordering
  • Services use IndexMap with topological sort (dependencies first)
  • Auto-generated healthchecks for services with known image type and mapped port
  • Project name lowercased in the name: field to match Docker conventions

README

  • Rewritten from scratch with honest positioning
  • Removed "production-ready" framing, replaced with "solid base with sane defaults"
  • Shorter (200 lines -> 110 lines), factual, includes DSL reference table

Metrics

Before After
Lines of code (src/) 3 669 3 120
#[allow(dead_code)] 36 0
Clippy warnings (default) 0 0
Clippy warnings (pedantic) 112 56
Unused dependencies 3 0
Tests passing 103 103

Jeck0v and others added 4 commits February 11, 2026 02:23
Dead code elimination:
- Remove optimized_parser.rs, AthenaConfig, legacy structs, dead methods
- 36 allow(dead_code) -> 0

Dependencies:
- Remove uuid, anyhow, tempfile; add indexmap

Rust idioms:
- Fix clippy pedantic, replace unwrap(), strip_prefix, explicit imports
- 112 clippy pedantic warnings -> 56

Docker Compose output:
- Remove container_name and pull_policy
- Deterministic output with BTreeMap/IndexMap
- Topological sort, auto-healthcheck, lowercase project name
- deploy.restart_policy only with Swarm features
Drop production-ready framing. Position Athena as a solid base
with sane defaults, not a magic production guarantee.
@Jeck0v Jeck0v self-assigned this Feb 11, 2026
@Jeck0v Jeck0v added bug Something isn't working enhancement New feature or request IMPORTANT labels Feb 11, 2026
@Jeck0v Jeck0v merged commit 18e2459 into main Feb 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request IMPORTANT

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant